package com.fei.controller;

import com.fei.bean.SongListBean;
import com.fei.bean.SongListMusicBean;
import com.fei.mapper.SongListMusicMapper;
import com.fei.service.SongListService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

@Controller
public class SongListMusicController {

    @Autowired
    SongListMusicMapper songListMusicMapper;
    @Autowired
    SongListService songListService;

    @RequestMapping("/user/ajax/songListMusic")
    public String songListMusic(Integer id, Model model){
        List<SongListMusicBean> songListMusicBean = songListMusicMapper.selectOneIdSong(id);
        SongListBean bean = songListService.selectOneIdSongListService(id);
//        右侧边
        List<SongListBean> songListBeancebianList = songListService.selectNotIdlimitFiveService(id);
        model.addAttribute("songListBeancebianList",songListBeancebianList);
        model.addAttribute("songListBean",bean);
        model.addAttribute("songListMusicBeanList",songListMusicBean);
        return "track-detail::songListMusic";
    }

}
